The TextField Component > FTextField.getIcon()

 

FTextField.getIcon()

Availability

Flash Player 6.

Usage

myTextField_txf.getIcon ()

Parameters

none

Returns

Returns a reference to the Movie Clip being used for the icon in the component.

Description

Returns a reference to the Movie Clip being used for the icon in the component. This allows you to call methods on and manipulate the Movie Clip being used as an icon on the component. If no icon has been defined, the method will return undefined.

 

Notes

The icon must be visible in order for the method to return a reference to it.

Example

The text_getIcon.fla example file contains an example of using this method.

The IconPlacer.as file contains a simple class that shows how to use the getIcon method to dynamically place the icon in different corners of the text field.

The following code assigns an icon to the textfield and then adjusts its placement.

myTextField_txf.setIcon("ftf_errorIcon");
myTextField_txf.getIcon()._y = 10;
myTextField_txf.showIcon(true);

See also

FTextField.setIcon()

FTextField.showIcon()